/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.converter;

import br.com.deployment.entidade.fermojupi.AtoCampo;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

/**
 *
 * @author elyjr
 */
@FacesConverter(value="atoCampoConverter", forClass=AtoCampo.class)  
public class AtoCampoConverter  implements Converter {

    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) {                
        AtoCampo atoCampo = new AtoCampo();
        atoCampo.setId(Integer.valueOf(value));  
        return atoCampo;
    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) {
         AtoCampo atoCampo = (AtoCampo) value;
        return "" + atoCampo.getId();
    }
    
}
